/*********************************************************
          File Name:t.cpp
          Author: Abby Cin
          Mail: abbytsing@gmail.com
          Created Time: Mon 14 Sep 2015 04:02:17 PM CST
**********************************************************/

#include <iostream>
using namespace std;

#include <vector>

int main()
{
        vector<int> v;

        for(int i=0; i<3; i++)
                v.insert(v.end(), i);   // another way, v.insert(iterator, n, value); insert n value at iterator

        vector<int> v1(v.begin(), v.end());

        for(auto x: v1)
                cout << x << endl;

        v1.clear();
        cout << "size of v1 = " << v1.size() << endl;
        
        v.erase(v.end() - 1);

        for(auto x: v)
                cout << x << endl;

        v.emplace(v.begin(), 309);

        cout << "-------------------------------\n";

        for(auto x: v)
                cout << x << endl;
}
